package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Order generated by hbm2java
 */
@Entity
@Table(name = "order", catalog = "shop")
public class Order implements java.io.Serializable {

	private Integer id;
	private Customer customer;
	private ProdRefund prodRefund;
	private String orderUuid;
	private String orderChanel;
	private Date orderTime;
	private String orderState;
	private Date orderPaytime;
	private String orderNote;
	private String orderLogisticType;
	private String orderPayType;
	private BigDecimal orderShipping;
	private BigDecimal orderPayment;
	private BigDecimal orderPaied;
	private boolean orderEnabled;
	private Integer logisticId;
	private Integer addressId;
	private Set<OrderRelate> orderRelates = new HashSet<OrderRelate>(0);

	public Order() {
	}

	public Order(Customer customer, String orderUuid, Date orderTime,
			String orderState, boolean orderEnabled) {
		this.customer = customer;
		this.orderUuid = orderUuid;
		this.orderTime = orderTime;
		this.orderState = orderState;
		this.orderEnabled = orderEnabled;
	}

	public Order(Customer customer, ProdRefund prodRefund, String orderUuid,
			String orderChanel, Date orderTime, String orderState,
			Date orderPaytime, String orderNote, String orderLogisticType,
			String orderPayType, BigDecimal orderShipping,
			BigDecimal orderPayment, BigDecimal orderPaied,
			boolean orderEnabled, Integer logisticId, Integer addressId,
			Set<OrderRelate> orderRelates) {
		this.customer = customer;
		this.prodRefund = prodRefund;
		this.orderUuid = orderUuid;
		this.orderChanel = orderChanel;
		this.orderTime = orderTime;
		this.orderState = orderState;
		this.orderPaytime = orderPaytime;
		this.orderNote = orderNote;
		this.orderLogisticType = orderLogisticType;
		this.orderPayType = orderPayType;
		this.orderShipping = orderShipping;
		this.orderPayment = orderPayment;
		this.orderPaied = orderPaied;
		this.orderEnabled = orderEnabled;
		this.logisticId = logisticId;
		this.addressId = addressId;
		this.orderRelates = orderRelates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "refund_id")
	public ProdRefund getProdRefund() {
		return this.prodRefund;
	}

	public void setProdRefund(ProdRefund prodRefund) {
		this.prodRefund = prodRefund;
	}

	@Column(name = "order_uuid", nullable = false, length = 32)
	public String getOrderUuid() {
		return this.orderUuid;
	}

	public void setOrderUuid(String orderUuid) {
		this.orderUuid = orderUuid;
	}

	@Column(name = "order_chanel", length = 14)
	public String getOrderChanel() {
		return this.orderChanel;
	}

	public void setOrderChanel(String orderChanel) {
		this.orderChanel = orderChanel;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "order_time", nullable = false, length = 19)
	public Date getOrderTime() {
		return this.orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	@Column(name = "order_state", nullable = false, length = 18)
	public String getOrderState() {
		return this.orderState;
	}

	public void setOrderState(String orderState) {
		this.orderState = orderState;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "order_paytime", length = 19)
	public Date getOrderPaytime() {
		return this.orderPaytime;
	}

	public void setOrderPaytime(Date orderPaytime) {
		this.orderPaytime = orderPaytime;
	}

	@Column(name = "order_note", length = 200)
	public String getOrderNote() {
		return this.orderNote;
	}

	public void setOrderNote(String orderNote) {
		this.orderNote = orderNote;
	}

	@Column(name = "order_logistic_type", length = 8)
	public String getOrderLogisticType() {
		return this.orderLogisticType;
	}

	public void setOrderLogisticType(String orderLogisticType) {
		this.orderLogisticType = orderLogisticType;
	}

	@Column(name = "order_pay_type", length = 8)
	public String getOrderPayType() {
		return this.orderPayType;
	}

	public void setOrderPayType(String orderPayType) {
		this.orderPayType = orderPayType;
	}

	@Column(name = "order_shipping", precision = 11)
	public BigDecimal getOrderShipping() {
		return this.orderShipping;
	}

	public void setOrderShipping(BigDecimal orderShipping) {
		this.orderShipping = orderShipping;
	}

	@Column(name = "order_payment", precision = 11)
	public BigDecimal getOrderPayment() {
		return this.orderPayment;
	}

	public void setOrderPayment(BigDecimal orderPayment) {
		this.orderPayment = orderPayment;
	}

	@Column(name = "order_paied", precision = 11)
	public BigDecimal getOrderPaied() {
		return this.orderPaied;
	}

	public void setOrderPaied(BigDecimal orderPaied) {
		this.orderPaied = orderPaied;
	}

	@Column(name = "order_enabled", nullable = false)
	public boolean isOrderEnabled() {
		return this.orderEnabled;
	}

	public void setOrderEnabled(boolean orderEnabled) {
		this.orderEnabled = orderEnabled;
	}

	@Column(name = "logistic_id")
	public Integer getLogisticId() {
		return this.logisticId;
	}

	public void setLogisticId(Integer logisticId) {
		this.logisticId = logisticId;
	}

	@Column(name = "address_id")
	public Integer getAddressId() {
		return this.addressId;
	}

	public void setAddressId(Integer addressId) {
		this.addressId = addressId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "order")
	public Set<OrderRelate> getOrderRelates() {
		return this.orderRelates;
	}

	public void setOrderRelates(Set<OrderRelate> orderRelates) {
		this.orderRelates = orderRelates;
	}

}
